<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        #box {
            width: 200px;
            height: 200px;
            background-color: red;
            position: relative;
        }
        #info {
            font-size: 20px;
            position:absolute
        }
    </style>
</head>

<body>
    <div id="box">
        <p id="info">看老子</p>
    </div>
    <button id="roc">点老子</button>

    <script>
        var oBox = document.getElementById('box');
        var oInfo = document.getElementById('info')
        var oRoc = document.getElementById('roc');

        oRoc.onclick = function () {
            oBox.style.backgroundColor= 'blue';
            oInfo.style.fontSize= '50px';
        }
        
    </script>
</body>

</html>